package com.atguigu.gmall.cart.config;

import com.atguigu.gmall.cart.exception.handler.CartAsyncUncaghtExceptionHandler;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;

import java.util.concurrent.Executor;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author: 86182
 * @Date: 2021/8/21
 * @Time: 1:14
 * @Version:
 */
@Configuration
public class AsyncConfig implements AsyncConfigurer {

    @Autowired
    private CartAsyncUncaghtExceptionHandler exceptionHandler;

    @Override
    public Executor getAsyncExecutor() {
        return null;
    }

    @Override
    public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
        return exceptionHandler;
    }
}
